﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.cruxomatic.DTOs;

namespace com.cruxomatic.logging
{
    public class ApplicationLogClassConverter
    {
        public static ApplicationLogMessageInformation CopyApplicationLogMessageToApplicationLogMessageInformation(ApplicationLogMessage applicationLogMessage)
        {
            ApplicationLogMessageInformation applicationLogMessageInformation = new ApplicationLogMessageInformation();
            applicationLogMessageInformation.MessageID = applicationLogMessage.MessageID;
            applicationLogMessageInformation.MessageText = applicationLogMessage.MessageText;
            applicationLogMessageInformation.MessageTypeOrSource = applicationLogMessage.MessageTypeOrSource;
            applicationLogMessageInformation.MessageStackTrace = applicationLogMessage.MessageStackTrace;
            return applicationLogMessageInformation;
        }

        public static ApplicationLogMessage CopyApplicationLogMessageInformationToApplicationLogMessage(ApplicationLogMessageInformation applicationLogMessage, ApplicationLogMessage dbApplicationLogMessage)
        {
            dbApplicationLogMessage.MessageID = applicationLogMessage.MessageID;
            dbApplicationLogMessage.MessageText = applicationLogMessage.MessageText;
            dbApplicationLogMessage.MessageTypeOrSource = applicationLogMessage.MessageTypeOrSource;
            dbApplicationLogMessage.MessageStackTrace = applicationLogMessage.MessageStackTrace;
            dbApplicationLogMessage.MessageDateTime = applicationLogMessage.MessageDateTime;
            return dbApplicationLogMessage;
        }

    }
}
